package com.sc.nft.service;

import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.dto.AddBoxConditionDTO;
import com.sc.nft.entity.dto.QueryBoxConditionDTO;
import com.sc.nft.entity.req.EcologyCastGasRequest;
import com.sc.nft.entity.vo.*;
import com.sc.nft.enums.BoxTakePoolConvertScenarioEnum;

import java.util.List;

/**
 * 盲盒兑换条件(BoxTakeConversionCondition)表服务接口
 *
 * @author 王伟成
 * @since 2023-11-07 16:54:54
 */
public interface BoxTakeConversionConditionService {

    /**
     * 新增盲盒兑换条件
     */
    void addBoxCondition(Boolean addBoxTaskPool, Long boxId, Integer type, Long productBoxId, Integer upperLimit, AddBoxConditionCollectionDTO addBoxConditionCollectionDTO, List<AddBoxConditionDTO> addBoxConditionDTOList, BoxTakePoolConvertScenarioEnum convertScenario, Long daoId, EcologyCastGasRequest ecologyCastGas);

    /**
     * 盲盒兑换条件查询
     *
     * @param queryBoxConditionDTO
     * @return
     */
    List<QueryBoxConditionVO> queryBoxCondition(QueryBoxConditionDTO queryBoxConditionDTO);

    /**
     * 判断用户是否满足兑换条件
     *
     * @param userId 用户id
     * @param boxId  盲盒id
     */
    WhetherUserMeetsRedemptionConditionsVO whetherUserMeetsRedemptionConditions(Long userId, Long boxId, Integer sum);


    /**
     * 扣除用户兑换配置
     *
     * @param userId
     * @param productBoxId
     * @param sum
     * @return
     */
    Boolean deductUserRedemptionConfiguration(Long userId, Long productBoxId, Integer sum);


    /**
     * 把对应盲盒的条件以 生态贡献凭证*1 这类的方式进行组合, 把藏品以逗号分隔进行组合.(正常只会有一个,但是要考虑未来有多个的场景)
     *
     * @param boxId
     * @return
     */
    BoxTakeConversionConditionCombination boxTakeConversionConditionCombination(Long boxId);

    /**
     * 用户前端获取兑换条件
     *
     * @param queryBoxConditionDTO
     * @param user
     * @return
     */
    QueryWebBoxConditionPackagingVO queryConversionConditions(QueryBoxConditionDTO queryBoxConditionDTO, UserInfo user);
}
